<template>
    <el-table :data="books" border style="width: 100%">
      <el-table-column  fixed prop="bookid" label="书籍id" width="150"></el-table-column>
      <el-table-column  fixed prop="bookname" label="书籍名称" width="150"></el-table-column>
      <el-table-column  fixed prop="author" label="作者" width="150"></el-table-column>
      <el-table-column  fixed prop="publisher" label="出版社" width="150"></el-table-column>
      <el-table-column  fixed prop="booktype" label="书籍类型" width="150"></el-table-column>
      <el-table-column  fixed prop="remain" label="数量" width="150"></el-table-column>
      <el-table-column    label="操作" width="100">
        <!-- <template slot-scope="scope"> -->
          <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
          <el-button type="text" size="small">编辑</el-button>
        <!-- </template> -->
      </el-table-column>
    </el-table>
  </template>

<script >
export default{
    methods: {
      handleClick(row) {
        console.log(row);
      }
    },
    name:"IndexView",
    data(){
        return{
            books:[],
            
        }
    },
    created(){
        axios.get("http://localhost:8088/books/selectAll").then((result) => {
            console.log(result)
             this.books = result.data
        }).catch((err) => {
            
        });
    }
}

</script>

<style>

</style>